/* Copyright (c) 2012, Roberto Javier Godoy.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Please contact Roberto Javier Godoy at <rjgodoy@fich.unl.edu.ar>,
 * <mail@rjgodoy.com.ar> if you need additional information or have any
 * questions.
 */
package ar.com.rjgodoy.sgml.sax;

import org.xml.sax.Attributes;
import org.xml.sax.ext.Attributes2;

/**
* Extension to augment the per-attribute information provided though {@link Attributes}.
* {@link SGMLReader} supports this extension (the {@code attributes} object provided in
* {@link org.xml.sax.ContentHandler#startElement ContentHandler.startElement()}
* implements this interface).
*
* <p>Note that if the value of an attribute was defaulted from its CURRENT value
* ({@code isCurrent}), it will be necessarily declared ({@code isDeclared})
* and defaulted ({@code !isSpecified}).
*
* <p>{@link #getType(int)} will return:
* <UL>
* <LI> {@code "CDATA"} if the attribute declared value[<A href="http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P145">145</A>], is CDATA (or if the attribute definition is implied),
* <LI> {@code "ID"} if the attribute declared value is ID
* <LI> {@code "TOKENIZED"} if the attribute type is one of
* IDREF, IDREFS, NAME, NAMES, NMTOKEN, NMTOKENS, NUMBER, NUMBERS, NUTOKEN, NUTOKENS,
* or a name token group.
* </UL>
* (ENTITY, ENTITES and notation attributes have not been tested yet)
*
* <p><b>Implementation Note</b>: a parser based on the Generic API to OpenSP cannot support
* {@link Attributes2}, because OpenSP reports whether the attribute <em>value</em> was defaulted
* from the attribute definition, and the contract of {@code Attributes2} reports whether
* the attribute was declared in the DTD.
*
* <P style="color:red;font-weight:bold">WARNING: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE</P>
*
* @author Roberto Javier Godoy
*/
public interface AttributesSgml extends Attributes {


	/**Returns false unless the value was defaulted from the CURRENT value of the attribute.
	 * @param index The attribute index (zero-based).
     * @return true if the attribute was defaulted from the CURRENT value of the attribute,
     *          false otherwise.
     * @exception java.lang.ArrayIndexOutOfBoundsException When the
     *            supplied index does not identify an attribute.*/
	boolean isCurrent(int index);

	/**Returns {@code true} if the attribute is a CDATA attribute.
	 * @param index The attribute index (zero-based).
     * @return {@code true} if the attribute is a CDATA attribute,
     *         {@code false} otherwise.
     * @exception java.lang.ArrayIndexOutOfBoundsException When the
     *            supplied index does not identify an attribute.*/
	//boolean isCdata(int index);

	/**Returns {@code true} if the attribute is a tokenized attribute (NMTOKEN,.
	 * NMTOKEN, NMTOKENS, NUMBER, NUMBERS, NUTOKEN, NUTOKENS).
	 * @param index The attribute index (zero-based).
     * @return {@code true} if the attribute is a CDATA attribute,
     *         {@code false} otherwise.
     * @exception java.lang.ArrayIndexOutOfBoundsException When the
     *            supplied index does not identify an attribute.*/
/*	boolean isTokenized(int index);

	boolean isId(int index);

	boolean isGroup(int index);*/



}
